package cn.edu.scau.cmi.wujiaxian.exercise4;

public class Triangle {
	void Pascal_triangle() {
		int[][] a = new int[10][10];
		int i, j;
		for (i = 0; i < 10; i++) {
			for (j = 0; j <= i; j++) {
				if (j == 0 || i == j)
					a[i][j] = 1;
				else {
					a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
				}
			}
		}
		for (i = 0; i < 10; i++) {
			for (j = 0; j <= i; j++)
				System.out.print(a[i][j] + ",");
			System.out.print("\n");
		}
	}
}
